import Mock from 'mockjs'

interface MediaBasicInfo {
  Status: string
  CreateTime: string
  BusinessType: string
  Title: string
  InputURL: string
  Source: string
  TranscodeStatus: string
  Biz: string
  MediaId: string
  ModifiedTime: string
  SpriteImages: string
  AppId: string
  UploadSource: string
  MediaType: string
  CoverURL: string
  Snapshots: string
}

interface MediaDynamicInfo {
  DynamicMetaData: {}
}

interface MediaInfo {
  MediaDynamicInfo: MediaDynamicInfo
  MediaId: string
  MediaBasicInfo: MediaBasicInfo
}

interface RootObject {
  TotalCount: number
  RequestId: string
  MaxResults: number
  MediaInfos: MediaInfo[]
}

export const listMediaBasicInfos = (data: {
  mediaTagId: string
  pageNo?: number
  pageSize?: number
}) => {
  return Promise.resolve(
    Mock.mock({
      totalCount: 2,
      requestId: 'B2B7E6F3-7B6B-4F5D-8B8B-1C1A1F4F7F1F',
      maxResults: 10,
      'mediaInfos|10': [
        {
          mediaDynamicInfo: {},
          mediaId: '@guid',
          mediaBasicInfo: {
            status: 'Normal',
            createTime: '@datetime',
            title: '@ctitle',
            inputURL: '@url',
            coverURL: '@image',
            'mediaType|1': ['video', 'image', 'audio']
          }
        }
      ]
    })
  )
}
